<!DOCTYPE html>
<html class="Content">
<head>
    <title>xUnit.js: Traits</title>
    <link type="text/css" rel="Stylesheet" href="../../Style/documentation.css" />
</head>
<body>
    <h1>Traits</h1>
    <p>
        The <strong>Trait</strong> attribute is used to specify custom categorizations of Facts and Fixtures. These can be used to isolate test runs to certain characteristics. 
        For example, you might specify an "Integration" trait, and mark any tests that cross known boundaries, e.g. file, database, web requests, etc.:
        <span class="Code">
[Fixture, <strong>Trait("Integration")</strong>]
function CanResolveDatabaseConnection(){

    [...]

}
        </span>
    </p>
    <p>
        These traits can then be specified in the console command, to either exclude, or run exclusively, the trait or traits specified:
    </p>
    <p>
        <strong>Exclude:</strong>
        <span class="Code">
cscript xUnit.js.Console.js /-trait:Integration Examples/Tests
        </span>
    </p>
    <p>
        <strong>Exclusive:</strong>
        <span class="Code">
cscript xUnit.js.Console.js /trait:Integration Examples/Tests
        </span>
    </p>
</body>
</html>